package com.example.ruiji.service.ltag;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.ruiji.dao.mapper.LtagMapper;
import com.example.ruiji.pojo.Ltag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Author:BaiYiChen
 * Date:2022/5/1 21:10
 *
 * @author BaiYiChen
 */
@Service
public class LtagServiceImpl implements LtagService{
  @Autowired
  private LtagMapper ltagMapper;
  @Override
  public List<Ltag> findAllLtag() {
    LambdaQueryWrapper<Ltag> queryWrapper = new LambdaQueryWrapper<>();
    queryWrapper.select(Ltag::getId,Ltag::getTagName);
    List<Ltag> list = ltagMapper.selectList(queryWrapper);
    return list;
  }
  
  @Override
  public Ltag findLtagById(Integer aId) {
    LambdaQueryWrapper<Ltag> queryWrapper = new LambdaQueryWrapper<>();
    queryWrapper.eq(Ltag::getId,aId);
    Ltag ltag =ltagMapper.selectOne(queryWrapper);
    return ltag;
  }
}
